﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SDT.Lib.Paging;
using SDT.Model;
using SDT.Systems;
using System.Web.Mvc;
using System.Web.UI.WebControls;

namespace SDT.Admin.ViewModels
{
    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 07/07/2011
    /// </summary>
    public class DemandViewModels
    {
        public DemandViewModels()
        {
        }

        public IPagedList<Demand> Demand
        {
            get;
            set;
        }

        private List<DemandCategory> _cat = new List<DemandCategory>();
        public List<DemandCategory> Categories
        {
            get
            {
                return this._cat;
            }
            set
            {
                if(value != null)
                    this._cat = value;
            }
        }

        public int CurrentCat;
        public int? CurrentPubStatus;
        public string Keyword;
        public List<SelectListItem> ListStatusPub
        {
            get
            {
                List<SelectListItem> list = new CommonType().ToList();
                if (this.CurrentPubStatus.HasValue)
                    list.SingleOrDefault(i => int.Parse(i.Value) == this.CurrentPubStatus.Value).Selected = true;

                return list;
            }
        }

        public string ImageRootUrl;
        // Inserted by Vietlv (AddDate: 25/07/2011)
        // Description: inset list DemandType and current demandType
        
        public List<DemandType> DemandTypes { get; set; }
        public int CurrentDemandTypes;
    }

    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 07/07/2011
    /// </summary>
    public class DemandInputModels
    {
        public DemandInputModels()
        {
        }

        private List<DemandCategory> _category = new List<DemandCategory>();
        public List<DemandCategory> Categories
        {
            get
            {
                return this._category;
            }
            set
            {
                if (value != null)
                    this._category = value;
            }
        }
        private List<City> _listCity = new List<City>();
        public List<City> ListCity
        {
            get
            {
                return this._listCity;
            }
            set
            {
                if (value != null)
                    this._listCity = value;
            }
        }

        private List<District> _listDistrict = new List<District>();
        public List<District> ListDistrict
        {
            get
            {
                return this._listDistrict;
            }
            set
            {
                if (value != null)
                    this._listDistrict = value;
            }
        }

        private Demand _demand = new Demand();
        public Demand Demand
        {
            get
            {
                return this._demand;
            }
            set
            {
                if (value != null)
                    this._demand = value;
            }
        }

        public int ID
        {
            get;
            set;
        }
        // Inserted by Vietlv (AddDate: 25/07/2011)
        // Description: inset list DemandType and object demandType
        public DemandType DemandType { get; set; }
        public List<DemandType> DemandTypes { get; set; }
        public int CurrentDemandType { get; set; }
        public Dictionary<object, object> ListCurrency = new Dictionary<object, object>();
        public Dictionary<object, object> ListUnitCost = new Dictionary<object, object>();
        public Dictionary<object, object> ListExpireDate = new Dictionary<object, object>();
    }
}
